package test.loader
{
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.net.URLRequest;

	public class QueueLoaders extends Sprite
	{
		public var loaders:Array = [];
		private var urls:Array ;
		public function QueueLoaders()
		{
		}
		
		public function setupUrls(urls:Array):void{
			var url:String = null;
			this.urls = urls;
			for each(url in urls){
				var l:Loader = new Loader();
				addChild(l);
					l.x = urls.indexOf(url) * 10;
					l.load(new URLRequest(url));
				loaders.push(l);
			}
		}
		public function startLoad():void{
			for each(var l:Loader in loaders){
				l.load(new URLRequest(urls[loaders.indexOf(l)]));
			}
		}
	}
}